//
//  SalesReturnHeaderView.m
//  JinFuThree
//
//  Created by 毛韶谦 on 2018/9/12.
//  Copyright © 2018年 毛韶谦. All rights reserved.
//

#import "SalesReturnHeaderView.h"

@implementation SalesReturnHeaderView



- (instancetype)init {
    
    self = [super init];
    if (self) {
        self.backgroundColor = [UIColor whiteColor];
        
        [self.leftImageView mas_makeConstraints:^(MASConstraintMaker *make) {
            make.size.mas_equalTo(CGSizeMake(80, 80));
            make.left.mas_equalTo(self.mas_left).offset(20);
            make.top.mas_equalTo(self.mas_top).offset(20);
        }];
        
        [self.titleLabel mas_makeConstraints:^(MASConstraintMaker *make) {
            make.top.mas_equalTo(self.leftImageView.mas_top);
            make.left.mas_equalTo(self.leftImageView.mas_right).offset(12);
            make.right.mas_equalTo(self.mas_right).offset(-20);
        }];
        [self.numberLabel mas_makeConstraints:^(MASConstraintMaker *make) {
            make.left.mas_equalTo(self.leftImageView.mas_right).offset(12);
            make.bottom.mas_equalTo(self.priceLabel.mas_top).offset(-10);
        }];
        [self.priceLabel mas_makeConstraints:^(MASConstraintMaker *make) {
            make.left.mas_equalTo(self.leftImageView.mas_right).offset(12);
            make.bottom.mas_equalTo(self.mas_bottom).offset(-20);
        }];
    }
    return self;
}


- (UIImageView *)leftImageView {
    
    if (!_leftImageView) {
        _leftImageView = [[UIImageView alloc] init];
        [_leftImageView setContentMode:UIViewContentModeScaleAspectFit];
        
        [self addSubview:_leftImageView];
    }
    return _leftImageView;
}
- (UILabel *)titleLabel {
    
    if (!_titleLabel) {
        _titleLabel = [[UILabel alloc] init];
        _titleLabel.font = [UIFont boldSystemFontOfSize:13];
        _titleLabel.textColor = HexColor(0x333333);
        _titleLabel.numberOfLines = 2;
        
        [self addSubview:_titleLabel];
    }
    return _titleLabel;
}
- (UILabel *)numberLabel {
    
    if (!_numberLabel) {
        _numberLabel = [[UILabel alloc] init];
        _numberLabel.font = [UIFont systemFontOfSize:12];
        _numberLabel.textColor = HexColor(0x888888);
        
        [self addSubview:_numberLabel];
    }
    return _numberLabel;
}
- (UILabel *)priceLabel {
    
    if (!_priceLabel) {
        _priceLabel = [[UILabel alloc] init];
        _priceLabel.font = [UIFont boldSystemFontOfSize:13];
        _priceLabel.textColor = HexColor(0xFF2244);
        
        [self addSubview:_priceLabel];
    }
    return _priceLabel;
}


/*
// Only override drawRect: if you perform custom drawing.
// An empty implementation adversely affects performance during animation.
- (void)drawRect:(CGRect)rect {
    // Drawing code
}
*/

@end
